#include <bits/stdc++.h>
using namespace std;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using ll = long long;
ll n, k;
const ll N = 1e5 + 100;
ll dp[N];
void solve()
{
    cin >> n >> k;
    dp[0] = dp[1] = 1;
    for (ll i = 2;i<=n;i++)
    {

        for (ll j = 1; j <= k;j++)
        {
            if(i>=j)
            dp[i] = (dp[i] + dp[i-j]) % 100003;
        }

    }
    cout << dp[n];
}
int main()
{
   int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
   return 0;
}
